package com.example.tijianbackend.utils;

/**
 * @author: bong~
 * @description: TODO
 * @date: 2024/6/25 15:16
 * @version: 1.0
 */

public class VerificationCodeUtil {

    public static String generator(int n){

        if(n<4 || n>6){
            n=4;
        }
        StringBuilder verificationCode=new StringBuilder(n);

        for(int i=0;i<n;i++){
            int digit=(int)(Math.random()*10);
            verificationCode.append(digit);
        }
        return verificationCode.toString();
    }
}
